package me.yricky.mayu.ui.fasta

import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.size
import androidx.compose.material.RadioButton
import androidx.compose.material.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.unit.dp
import me.yricky.mayu.utils.fasta.Parser

/**
 * @author Yricky
 * @date 2022/4/18
 */
@Composable
fun FastaSeqModel.ParserSelector(modifier: Modifier = Modifier){
    Row(modifier,verticalAlignment = Alignment.CenterVertically) {
        RadioButton(
            parser == Parser.NAParser,
            { parser = Parser.NAParser },
            Modifier.size(24.dp)
        )
        Text("核苷酸", textAlign = TextAlign.Center)
        Spacer(Modifier.size(8.dp))
        RadioButton(
            parser == Parser.PParser,
            {parser = Parser.PParser},
            Modifier.size(24.dp)
        )
        Text("氨基酸", textAlign = TextAlign.Center)
    }
}